]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: Don't wait for gdk-pixbuf to fail before loading animations
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 3 Dec 2013 20:56:12 +0000 (15:56 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 4 Dec 2013 00:13:12 +0000 (19:13 -0500)
We don't have any better way of determining whether something is a slideshow
animation, so discriminate on the .xml filename instead of waiting for
gdk-pixbuf to determine whether it can load a file or not.

https://bugzilla.gnome.org/show_bug.cgi?id=719803

js/ui/background.js

index 0a21bd239cf48ab4dc255a2494f616ea1692f0ce..5f11e577754f49115c283696ceddc952ff095734 100644 (file)
@@ -536,24 +536,25 @@ const Background = new Lang.Class({
                                            });
     },
 
-    _loadFile: function(filename) {
+    _loadImage: function(filename) {
         this._cache.getImageContent({ monitorIndex: this._monitorIndex,
                                       effects: this._effects,
                                       style: this._style,
                                       filename: filename,
                                       cancellable: this._cancellable,
                                       onFinished: Lang.bind(this, function(content) {
-                                          if (!content) {
-                                              if (!this._cancellable.is_cancelled())
-                                                  this._loadAnimation(filename);
-                                              return;
-                                          }
-
-                                          this._addImage(content, 0, filename);
+                                          if (content)
+                                              this._addImage(content, 0, filename);
                                           this._setLoaded();
                                       })
                                     });
+    },
 
+    _loadFile: function(filename) {
+        if (filename.endsWith('.xml'))
+            this._loadAnimation(filename);
+        else
+            this._loadImage(filename);
     },
 
     _load: function () {